Chris Pollett >Old Classes >
CS151

( Print View )

Student Corner:
  [Grades Sec5]

  [Submit Sec5]

  [Email List Sec5]

  [
Lecture Notes]

Course Info:
  [Texts & Links]
  [Topics]
  [Grading]
  [HW Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]

Practice Exams:
  [Mid1]  [Mid2]  [Final]

                           












CS151 Fall 2005Practice Midterm 1

[Student Generated Solutions-PDF]

To study for the midterm I would suggest you: (1) Know how to do (by heart) all the practice problems. (2) Go over your notes three times. Second and third time try to see how huch you can remember from the first time. (3) Go over the homework problems. (4) Try to create your own problems similar to the ones I have given and solve them. (5) Skim the relevant sections from the book. (6) If you want to study in groups, at this point you are ready to quiz each other. The practice midterm is below. Here are some facts about the actual midterm: (a) The midterm will be in class Sep 28. (b) It is closed book, closed notes. Nothing will be permitted on your desk except your pen (pencil) and test. (c) You should bring photo ID. (d) There will be more than one version of the test. Each version will be of comparable difficulty. (e) If your cell-phone or beeper goes off you will be excused from the test at that point and graded on what you have done till your excusal. (f) One problem (less typos) on the actual test will be from the practice test.

1. Briefly define the following concepts: control-flow programming, data-flow programming, object oriented programming.

2. Draw UML class diagrams which represent: (a) a class which implements an interface for a protected method doStuff(). (b) a class Musician with a private field state and which has an Instrument object with a playNote() method.

3. Convert the following scenario into a UML sequence diagram: A Person turns their Key in the Car's Ignition Switch until the Person hears the Car Engine catch.

4. Give an example use-case diagram of a volume control widget for a computer desktop showing at least two scenarios.

5. Briefly explain what kind of checks are done during Java byte code verification.

6. Explain and give an example of how ant's target and property tags work.

7. Explain how x/y is handle when y is 0 and (a) x is some nonzero int or (b) x is some nonzero float.

8. Explain how to create a Java method which takes a variable number of arguments. Give an example.

9. What does it mean when a subclass is a restriction of its parent class? How can restrictions be implemented in Java?

10. What is a Marker Interface? Give examples. What is the difference between overriding a method and hiding it?